package helloworld.admin.assembler.course;

import java.lang.reflect.InvocationTargetException;
import org.apache.commons.beanutils.BeanUtils;
import helloworld.admin.bean.CourseAdminBean;
import helloworld.admin.form.course.CourseForm;

/** 
 * @author TUYEN-DM
 *         <p>
 *         2009/05/13
 *         </p>
 *         <p>
 *         CourseDetailAssembler is the object to process copyProperties of CourseDetail.
 *         </p>
 */
public class CourseDetailAssembler
{
	private CourseDetailAssembler() { }

	public static final CourseAdminBean createCourseDetail(CourseForm form)
	{
		CourseAdminBean center = new CourseAdminBean();
		try
		{
			BeanUtils.copyProperties(center, form);
			//BeanUtils.copyProperties(center.getAddress(), form.getAddress());
		}
		catch (InvocationTargetException ite)
		{
			ite.printStackTrace();	//do nothing for now
		}
		catch (IllegalAccessException iae)
		{
			iae.printStackTrace();	//do nothing for now
		}
		return center;		
	}

}